import { storage } from "@/utils/storage"

export const useAuthStore = defineStore("auth", () => {
  const myToken = ref("")

  const setToken = (token: string) => {
    storage.set("token", token)
    myToken.value = token
  }

  const getToken = () => {
    myToken.value = storage.get("token")
    return myToken.value
  }

  return { myToken, getToken, setToken }
})
